﻿/*
 * Created by SharpDevelop.
 * User: Andrew Sadler
 * Date: 03/09/2012
 * Time: 12:06
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace RRRSRoguelike.Helpers
{
	/// <summary>
	/// Description of Menu.
	/// </summary>
	public class MenuItem
	{
		/// <summary>
		/// text for menuitem
		/// </summary>
		public string Text;
		/// <summary>
		/// event to fire upon selection
		/// </summary>
		public event EventHandler SelectEvent;
	
		/// <summary>
		/// constructor
		/// </summary>
		/// <param name="text"></param>
		/// <param name="handler"></param>
		public MenuItem(string text, EventHandler handler)
		{
			Text = text;
			SelectEvent += handler;
		}
		
		/// <summary>
		/// Fires select event
		/// </summary>
		public void Select()
		{
			if (SelectEvent!=null)
				SelectEvent(this,null);
		}
	
	}
}
